from django.db import models


class PersonInfo(models.Model):
    name = models.CharField(max_length=100)
    age = models.IntegerField()

    def __str__(self):
        return self.name

    class Meta:
        verbose_name = '人员信息'
        # db_table = 'person_info'


class Vocation(models.Model):
    job = models.CharField(max_length=100)
    title = models.CharField(max_length=100)
    payment = models.CharField(max_length=100)
    person = models.ForeignKey(PersonInfo, on_delete=models.CASCADE)

    def __str__(self):
        return self.job

    class Meta:
        verbose_name = '职业信息'
